layui.use(['layer','util'],function () {
    var layer = layui.layer;
    var util = layui.util;
    $('#gogogo').click(function () {
        layer.open({
            type: 1,
            title: false,
            area: ['90%', '35%'],
            anim: 5,
            shadeClose: false,
            content: $('#zzc'), //这里content是一个普通的String

        });
    });

    var url = "http://120.26.76.247/";

    // 正则表达式获取设备编号
    function getQueryString(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
        var r = window.location.search.substr(1).match(reg);
        if (r != null) return decodeURI(r[2]);
        return null;
    }
    $.ajax({
        url:url+'api/getSurpriseShopById',
        type:'get',
        data:{
            shopId : getQueryString('id')
        },
        datatype:'json',
        success:function (return_data) {
            var data = JSON.parse(return_data);
            var res = data.data;
            $('#pic1 img').attr('src',res['pic1']);
            $('#pic2 img').attr('src',res['pic2']);
            $('#pic3 img').attr('src',res['pic3']);
            $('#pic4 img').attr('src',res['pic4']);
             if(res.type == 1){
                $('#pic6 img').attr('src',res['qrcode']);
                $('#erweima').show();
                $('#gzh').show();
            }
            $('#pic5 img').attr('src',res['pic5']);

            $('#wenzi').html(res.qrname);
            $('#wangzhi').attr('href',res.url);
            $('#wangzhi').html(res.url);
        }
    });
});